shouldNotBeIn

Verify that the value is not in the container.

  1. void shouldNotBeIn(in auto ref T value, in auto ref U container, in string file = __FILE__, in size_t line = __LINE__)
  2. void shouldNotBeIn(in auto ref T value, U container, in string file = __FILE__, in size_t line = __LINE__)
    void
    shouldNotBeIn
    (
    T
    U
    )
    (
    in auto ref T value
    ,,
    in string file = __FILE__
    ,
    in size_t line = __LINE__
    )
    if (
    !isLikeAssociativeArray!(U, T) &&
    isInputRange!U
    )

Throws

UnitTestException on failure

Examples

1 auto arrayRangeWithoutLength(T)(T[] array) {
2     struct ArrayRangeWithoutLength(T) {
3     private:
4         T[] array;
5     public:
6         T front() const @property {
7             return array[0];
8         }
9 
10         void popFront() {
11             array = array[1 .. $];
12         }
13 
14         bool empty() const @property {
15             return array.empty;
16         }
17     }
18 
19     return ArrayRangeWithoutLength!T(array);
20 }
21 
22 shouldNotBeIn(3.5, [1.1, 2.2, 4.4]);
23 shouldNotBeIn(1.0, [2.0 : 1, 3.0 : 2]);
24 shouldNotBeIn(1, arrayRangeWithoutLength([2, 3, 4]));

Meta